﻿using System;
using System.Data;

public partial class System_Pages_Settings_Email : SiteFox.Base.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteFox.Business.Model.Site _Site = SiteFox.Business.Manager.Site.Get();
            ucc_SMTP_Host.Value = _Site.EmailSmtpHost;
            ucc_SMTP_From.Value = _Site.EmailSmtpFrom;
            ucc_SMTP_Username.Value = _Site.EmailSmtpUsername;
            ucc_SMTP_Password.Value = _Site.EmailSmtpPassword;
        }
    }
    protected void lib_Save_Click(object sender, EventArgs e)
    {
        SiteFox.Business.Model.Site _Site = SiteFox.Business.Manager.Site.Get();
        _Site.EmailSmtpHost = ucc_SMTP_Host.Value;
        _Site.EmailSmtpFrom = ucc_SMTP_From.Value;
        _Site.EmailSmtpUsername = ucc_SMTP_Username.Value;
        _Site.EmailSmtpPassword = ucc_SMTP_Password.Value;
        SiteFox.Business.Manager.Site.Edit(_Site);
        ucc_Message.Value = Resources.dcCommon.dc_SettingSuccessfullySaved;
    }
}